package org.example.session;

import org.example.builder.xml.XMLConfigBuilder;
import org.example.session.defaults.DefaultSqlSessionFactory;

import java.io.Reader;

/**
 * @Author: luyg
 * @Date: 2024/11/10/17:04
 * @Description:
 */
public class SqlSessionFactoryBuilder {


    public SqlSessionFactory build(Reader reader) {
        XMLConfigBuilder xmlConfigBuilder = new XMLConfigBuilder(reader);
        return build(xmlConfigBuilder.parse());

    }

    public SqlSessionFactory build(Configuration config) {
        return new DefaultSqlSessionFactory(config);
    }
}
